﻿
Imports elpmis

Namespace internalFunctions
    Public MustInherit Class _saftysigning
        Inherits inputIFunction(Of String, String)

        Protected NotOverridable Overrides Function finder() As iVariableFinder(Of String)
            Return string_finder()
        End Function

        Protected MustOverride Overrides Function invoke(ByVal i As String, ByRef o As String) As Boolean

        Protected NotOverridable Overrides Function returnType() As typeDefination
            Return typeDefination.string
        End Function

        Protected Sub New(ByVal name As String, Optional ByVal a As aliases = Nothing)
            MyBase.New(name, a)
        End Sub
    End Class

    Public Class md5_encoding
        Inherits _saftysigning

        Public Sub New()
            MyBase.New("safty.md5")
        End Sub

        Protected Overrides Function invoke(ByVal i As String, ByRef o As String) As Boolean
            Return safty.md5Calculator.signing(i, o)
        End Function
    End Class

    Public Class sha1_encoding
        Inherits _saftysigning

        Public Sub New()
            MyBase.New("safty.sha1")
        End Sub

        Protected Overrides Function invoke(ByVal i As String, ByRef o As String) As Boolean
            Return safty.sha1Calculator.signing(i, o)
        End Function
    End Class

    Public Class sha256_encoding
        Inherits _saftysigning

        Public Sub New()
            MyBase.New("safty.sha256")
        End Sub

        Protected Overrides Function invoke(ByVal i As String, ByRef o As String) As Boolean
            Return safty.sha256Calculator.signing(i, o)
        End Function
    End Class

    Public Class sha384_encoding
        Inherits _saftysigning

        Public Sub New()
            MyBase.New("safty.sha384")
        End Sub

        Protected Overrides Function invoke(ByVal i As String, ByRef o As String) As Boolean
            Return safty.sha384Calculator.signing(i, o)
        End Function
    End Class

    Public Class sha512_encoding
        Inherits _saftysigning

        Public Sub New()
            MyBase.New("safty.sha512")
        End Sub

        Protected Overrides Function invoke(ByVal i As String, ByRef o As String) As Boolean
            Return safty.sha512Calculator.signing(i, o)
        End Function
    End Class
End Namespace
